const daoCommon = require("../util/daoCommon");

const dao = {
    /**
     * @desc 查询图片列表
     * @author cbl
     * @date 2018/4/17
     */

    searchFileList: (data) => {
        let sql = '';
        return daoCommon.selectCommon(sql, data);
    },
    handleUploadMain: (data) => {
        let sql, data1 = {};
        const date = new Date();
        const updated_time = date.toLocaleString();
        data1.img_url = data;
        data1.updatedTime = updated_time;

        sql = `UPDATE picture SET picture_url=$img_url,updated_time=$updatedTime where picture_type='1'`;
        return daoCommon.queryCommon(sql, data1);
    }
};
module.exports = dao;